﻿using System.Collections.Generic;
using Monkey.Warrenty.Bo;
using Monkey.Warrenty.EntityModel;
using MonkeyWarranty.Models.WarrantyModels;

namespace Monkey.Warrenty.Data.Interfaces
{
    public interface IWarrantyTicketDao
    {
        List<WarrantyTicketView> GetTicketViews(int startIndex, int pageSize, string sorting, int status);
        List<WarrantyTicketView> GetActiveTicketViews(int startIndex, int pageSize, string sorting);
        int GetTicketCountByFilter(int statusId);
        int GetActiveTicketCount();
        long GetCurrentIdentity();
        WarrantyTicket GetById(long id);
        int SearchTicketsCount(WarrantySearchModel searchModel);
        List<WarrantyTicketView> SearchTickets(WarrantySearchModel searchModel);

        WarrantyTicket AddTicket(WarrantyTicket ticket);
        void UpdateTicket(WarrantyTicket ticket);
        void DeleteTicket(long id);

        List<WarrantyTicketProductView> GetTicketProducts(long ticketId);
        void DeleteTicketProduct(long ticketProductId);
        List<WarrantyTicketLendProductView> GetTicketLendProducts(long ticketId);
        void DeleteTicketLendProduct(long ticketProductId);
        WarrantyTicket_Product CreateTicketProduct(WarrantyTicket_Product ticketProduct);
        WarrantyTicket_LendProduct CreateTicketLendProduct(WarrantyTicket_LendProduct ticketProduct);
        WarrantyTicket_Product GetTicketProductById(long id);
        void UpdateTicketProduct(WarrantyTicket_Product ticketProduct);

        WarrantyTicket_LendProduct GetTicketLendProductById(long id);
        void UpdateTicketLendProduct(WarrantyTicket_LendProduct ticketProduct);

        void UpdateTicketStatus(long ticketId, int status);

        // printing
        WarrantyTicketPrintBo GetWarrantyTicketForPrint(long id);
        List<TaskServiceBo> GetWarrantyTicketProductsForPrint(long id);
        List<TaskServiceBo> GetWarrantyTicketLendProductsForPrint(long id);
    }
}
